package thread;

import java.util.Scanner;

public class demo1 {
    public  static int i = 0;



    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            while(i == 0) {

            }

            System.out.println("t1 end");
        });
        t1.start();
        Thread t2 = new Thread(() -> {
            System.out.println("请输入i: ");
            Scanner scanner = new Scanner(System.in);
            i = scanner.nextInt();
        });
        t2.start();
    }
}
